package edu.hitsz.prop;

import edu.hitsz.aircraft.HeroAircraft;
import edu.hitsz.shootStrategy.ShootDirect;
import edu.hitsz.shootStrategy.ShootScatter;

public class BulletProp extends AbstractProp {


    public BulletProp(int locationX, int locationY, int speedX, int speedY) {
        super(locationX, locationY, speedX, speedY);
    }

    @Override
    public void propAction() {

        HeroAircraft heroAircraft=HeroAircraft.getInstance();
        heroAircraft.setShootStrategy(new ShootScatter());

        try {
            Thread.sleep(5000);
            heroAircraft.setShootStrategy(new ShootDirect());
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
